using GroupSix.Domain.Entity.App;
using GroupSix.Domain.common;

namespace GroupSix.Domain.Repositories;

/// <summary>
/// 系统设置仓储接口
/// </summary>
public interface ISystemSettingRepository : IRepository<GsSystemSetting>
{
    /// <summary>
    /// 根据键获取设置
    /// </summary>
    /// <param name="settingKey">设置键</param>
    /// <returns>系统设置</returns>
    Task<GsSystemSetting?> GetByKeyAsync(string settingKey);

    /// <summary>
    /// 根据分组获取设置列表
    /// </summary>
    /// <param name="group">分组</param>
    /// <returns>设置列表</returns>
    Task<List<GsSystemSetting>> GetByGroupAsync(string group);

    /// <summary>
    /// 分页查询系统设置
    /// </summary>
    /// <param name="query">查询条件</param>
    /// <returns>分页结果</returns>
    Task<PageResult<GsSystemSetting>> GetPagedAsync(PageRequest query);

    /// <summary>
    /// 检查设置键是否存在
    /// </summary>
    /// <param name="settingKey">设置键</param>
    /// <param name="excludeId">排除的ID</param>
    /// <returns>是否存在</returns>
    Task<bool> ExistsByKeyAsync(string settingKey, Guid? excludeId = null);

    /// <summary>
    /// 批量更新设置
    /// </summary>
    /// <param name="settings">设置列表</param>
    /// <returns>更新结果</returns>
    Task<bool> UpdateBatchAsync(List<GsSystemSetting> settings);
} 